import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Login from "@/views/Login";
import User from "@/views/sys/User";
import Role from "@/views/sys/Role";
import Permission from "@/views/sys/Permission";

const routes = [
    {
        path: '/home',
        name: 'home',
        component: HomeView,
        children: [
            {
                path: '/sys/user',
                name: 'user',
                component: User
            },
            {
                path: '/sys/role',
                name: 'role',
                component: Role
            },
            {
                path: '/sys/permission',
                name: 'permission',
                component: Permission
            },
        ]
    },
    {
        path: '/',
        name: 'login',
        component: Login
    },
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
